Inhaltsverzeichnis

  1. About
  2. Usage
  3. Acknowledgment

About

This wiki demonstrates the use of the Form macro. A reference documentation of the Form macro can be found at MacroMarket/Form. Some technical details regarding this form can be found at /TechnicalDetails.

Usage

Use the filter (blue) to narrow the recipes displayed (yellow) to those matching the criteria. You can edit the recipes, modify the ingredients and add your own recipes too.

Name

<<Form(Text, FrontPage/FormsDict.recipe.@Name)>>

Category

Energy

- Cal.

Time

- minutes

Difficulty

-

Procedure

--> -->

KeyError

'index'

If you want to report a bug, please save this page and attach it to your bug report.

Traceback

A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.

  1. G:\INSTALL\Python\Moin\moin-1.6.2\FormDemo\MoinMoin\request\__init__.py in run (self=<MoinMoin.request.request_standalone.Request object>)

    1. 1281 self.page.send_page(msg=msg)
    2. 1282 else:
    3. 1283 handler(self.page.page_name, self)
    4. 1284
    5. 1285 # every action that didn't use to raise MoinMoinNoFooter must call this now:
    • handler = <function do_show>
    • self = <MoinMoin.request.request_standalone.Request object>
    • self.page = <MoinMoin.Page.Page object>
    • self.page.page_name = u'FrontPage'
  2. G:\INSTALL\Python\Moin\moin-1.6.2\FormDemo\MoinMoin\action\__init__.py in do_show (pagename=u'FrontPage', request=<MoinMoin.request.request_standalone.Request object>, content_only=0, count_hit=1, cacheable=1, print_mode=0)

    1. 237 count_hit=count_hit,
    2. 238 print_mode=print_mode,
    3. 239 content_only=content_only,
    4. 240 )
    5. 241
    • content_only = 0
  3. G:\INSTALL\Python\Moin\moin-1.6.2\FormDemo\MoinMoin\Page.py in send_page (self=<MoinMoin.Page.Page object>, msg='', **keywords={'content_only': 0, 'count_hit': 1, 'print_mode': 0})

    1. 1167 format_args=pi['formatargs'],
    2. 1168 do_cache=do_cache,
    3. 1169 start_line=pi['lines'])
    4. 1170
    5. 1171 # check for pending footnotes
    • start_line undefined
    • pi = {'acl': <MoinMoin.security.AccessControlList instance>, 'format': 'wiki', 'formatargs': '', 'language': 'en', 'lines': 0}
  4. G:\INSTALL\Python\Moin\moin-1.6.2\FormDemo\MoinMoin\Page.py in send_page_content (self=<MoinMoin.Page.Page object>, request=<MoinMoin.request.request_standalone.Request object>, body=u'<<TableOfContents>>\n<<Navigation(children,1)>>\n\n...aken from http://en.wikibooks.org/wiki/Cookbook.\n', format='wiki', format_args='', do_cache=1, **kw={'start_line': 0})

    1. 1255 try:
    2. 1256 code = self.loadCache(request)
    3. 1257 self.execute(request, parser, code)
    4. 1258 except Exception, e:
    5. 1259 if not is_cache_exception(e):
    • self = <MoinMoin.Page.Page object>
    • self.execute = <bound method Page.execute of <MoinMoin.Page.Page object>>
    • request = <MoinMoin.request.request_standalone.Request object>
    • parser = <MoinMoin.parser.text_moin_wiki.Parser instance>
    • code = <code object ? at 00F13DA0, file "FrontPage", line 2>
  5. G:\INSTALL\Python\Moin\moin-1.6.2\FormDemo\MoinMoin\Page.py in execute (self=<MoinMoin.Page.Page object>, request=<MoinMoin.request.request_standalone.Request object>, parser=<MoinMoin.parser.text_moin_wiki.Parser instance>, code=<code object ? at 00F13DA0, file "FrontPage", line 2>)

    1. 1286 __file__ = os.path.join(MoinMoin.__loader__.archive, 'dummy')
    2. 1287 try:
    3. 1288 exec code
    4. 1289 except "CacheNeedsUpdate": # convert the exception
    5. 1290 raise Exception("CacheNeedsUpdate")
    • code = <code object ? at 00F13DA0, file "FrontPage", line 2>
  6. G:\INSTALL\Python\Moin\moin-1.6.2\FormDemo\FrontPage in ?

  7. G:\INSTALL\Python\Moin\moin-1.6.2\FormDemo\MoinMoin\formatter\__init__.py in macro (self=<MoinMoin.formatter.text_html.Formatter instance>, macro_obj=<MoinMoin.macro.Macro instance>, name=u'Form', args=u'Hidden, FrontPage/FormsDict.recipe.Id', markup=u'<<Form(Hidden, FrontPage/FormsDict.recipe.Id)>>')

    1. 305 # call the macro
    2. 306 try:
    3. 307 return macro_obj.execute(name, args)
    4. 308 except ImportError, err:
    5. 309 errmsg = unicode(err)
    • macro_obj = <MoinMoin.macro.Macro instance>
    • macro_obj.execute = <bound method Macro.execute of <MoinMoin.macro.Macro instance>>
    • name = u'Form'
    • args = u'Hidden, FrontPage/FormsDict.recipe.Id'
  8. G:\INSTALL\Python\Moin\moin-1.6.2\FormDemo\MoinMoin\macro\__init__.py in execute (self=<MoinMoin.macro.Macro instance>, macro_name=u'Form', args=u'Hidden, FrontPage/FormsDict.recipe.Id')

    1. 114 else:
    2. 115 raise ImportError("Cannot load macro %s" % macro_name)
    3. 116 return execute(self, args)
    4. 117
    5. 118 def _m_lang(self, text):
    • execute = <function execute>
    • self = <MoinMoin.macro.Macro instance>
    • args = u'Hidden, FrontPage/FormsDict.recipe.Id'
  9. G:\INSTALL\Python\Moin\moin-1.6.2\FormDemo\wiki\data\plugin\macro\Form.py in execute (macro=<MoinMoin.macro.Macro instance>, args=[u'Hidden', u'FrontPage/FormsDict.recipe.Id'])

    1. 16 if not hasattr(request, 'form_macro_form'):
    2. 17 request.form_macro_form = Form(request)
    3. 18 return request.form_macro_form.render(args)
    4. 19
    5. 20
    • request = <MoinMoin.request.request_standalone.Request object>
    • request.form_macro_form = <wikiconfig.plugin.macro.Form.Form instance>
    • request.form_macro_form.render = <bound method Form.render of <wikiconfig.plugin.macro.Form.Form instance>>
    • args = [u'Hidden', u'FrontPage/FormsDict.recipe.Id']
  10. G:\INSTALL\Python\Moin\moin-1.6.2\FormDemo\wiki\data\plugin\macro\Form.py in render (self=<wikiconfig.plugin.macro.Form.Form instance>, args=[u'Hidden', u'FrontPage/FormsDict.recipe.Id'])

    1. 148 return self.render_next()
    2. 149 else:
    3. 150 return self.render_field(element, args)
    4. 151
    5. 152
    • self = <wikiconfig.plugin.macro.Form.Form instance>
    • self.render_field = <bound method Form.render_field of <wikiconfig.plugin.macro.Form.Form instance>>
    • element = u'hidden'
    • args = [u'Hidden', u'FrontPage/FormsDict.recipe.Id']
  11. G:\INSTALL\Python\Moin\moin-1.6.2\FormDemo\wiki\data\plugin\macro\Form.py in render_field (self=<wikiconfig.plugin.macro.Form.Form instance>, element=u'hidden', args=[u'Hidden', u'FrontPage/FormsDict.recipe.Id'])

    1. 193 field_name = self.field_name
    2. 194 field_key = '%s.%s' % (self.form_key, field_name)
    3. 195 value = self.wikiutil.escape(self.get_field_value(self.form_key, field_name, field_key) or '', 1)
    4. 196
    5. 197 if element == 'value':
    • value undefined
    • self = <wikiconfig.plugin.macro.Form.Form instance>
    • self.wikiutil = <module 'MoinMoin.wikiutil' from 'G:\INSTALL\Python\Moin\moin-1.6.2\FormDemo\MoinMoin\wikiutil.py'>
    • self.wikiutil.escape = <function escape>
    • self.get_field_value = <bound method Form.get_field_value of <wikiconfig.plugin.macro.Form.Form instance>>
    • self.form_key = u'FrontPage/FormsDict.recipe'
    • field_name = u'Id'
    • field_key = u'FrontPage/FormsDict.recipe.Id'
  12. G:\INSTALL\Python\Moin\moin-1.6.2\FormDemo\wiki\data\plugin\macro\Form.py in get_field_value (self=<wikiconfig.plugin.macro.Form.Form instance>, form_key=u'FrontPage/FormsDict.recipe', field_name=u'Id', field_key=u'FrontPage/FormsDict.recipe.Id', for_action=0)

    1. 225 elif not for_action:
    2. 226 form = self.forms[form_key]
    3. 227 index = form['index']
    4. 228 records = form['records']
    5. 229 if index > len(records):
    • index undefined
    • form = {'addonly': False, 'dict': {u'.file': u'`attachment:Recipes.db`', u'.type': u'`sqlite`', u'ingredients_of_recipe.all': u'1', u'ingredients_of_recipe.body': ru`|| <<Form(Hidden, .Id)>><<Form(Text, .Quantity,..., 50)>> || <<Form(Buttons)>><<Form(Next)>> ||\n`u, u'ingredients_of_recipe.delete': u'`delete from Ingredients where Id=?`', u'ingredients_of_recipe.delete_parameters': u'`.Id`', u'ingredients_of_recipe.header': ru`|| '''Quantity''' || '''Unit''' || '''Ingredient''' || ||\n`u, u'ingredients_of_recipe.insert': u'`insert into Ingredients(RecipeId, Quantity, Unit, Ingredient) values(?, ?, ?, ?)`', u'ingredients_of_recipe.insert_parameters': u'`.recipe.Id, .Quantity, .Unit, .Ingredient`', u'ingredients_of_recipe.select': u'`select * from Ingredients where RecipeId=? order by Ingredient`', ...}, 'dict_name': u'FrontPage/FormsDict', 'form_name': u'recipe'}

KeyError

'index'

  • args = ('index',)

System Details

  • Date: Tue, 25 Mar 2008 15:06:38 +0000
  • Platform: win32 (nt)
  • Python: Python 2.4 (E:\Apps\Python24\python.exe)
  • MoinMoin: Release 1.6.0 (release)